#include <stdarg.h>
#include "iostream"

void  log(char* buf, const char* format ,...)
{
    va_list myarg;
    va_start(myarg, format);

    vsnprintf(buf, 1024, format, myarg);
}

int main()
{
    char buf [1024];
    log( buf, "zhang %d %s", 10, "xuefeng");
    
    std::cout<<buf<<std::endl;


    return 0;
}

// c语言的可变参数
// va_list,